package com.itheima.test03;
//创建一个sportsman类,他是一个子类,他继承person类;
public class sportsman extends person {
    //私有两个成员变量;
    private String classid;
    private String classname;
    //空参构造方法;


    public sportsman() {
    }
    //有参构造;
    public sportsman(String name, char sex, int age, String classid, String classname) {
        super(name, sex, age);
        this.classid = classid;
        this.classname = classname;
    }
    //set,get方法;


    public String getClassid() {
        return classid;
    }

    public void setClassid(String classid) {
        this.classid = classid;
    }

    public String getClassname() {
        return classname;
    }

    public void setClassname(String classname) {
        this.classname = classname;
    }
    //父类方法重写;
    @Override
    public void eat(){
        System.out.println("运动员吃营养餐");
    }
}
